home *** CD-ROM | disk | FTP | other *** search
Wrap
VERSION 5.00 Object = "{13E51000-A52B-11D0-86DA-00608CB9FBFB}#5.0#0"; "VCF15.OCX" Begin VB.Form Accounts Caption = "Money Management" ClientHeight = 8370 ClientLeft = 60 ClientTop = 690 ClientWidth = 10710 LinkTopic = "Form1" ScaleHeight = 8370 ScaleWidth = 10710 StartUpPosition = 2 'CenterScreen Begin VB.Frame frmSheetName Caption = "Accounts" BeginProperty Font Name = "Arial" Size = 14.25 Charset = 0 Weight = 700 Underline = 0 'False Italic = -1 'True Strikethrough = 0 'False EndProperty Height = 8175 Left = 0 TabIndex = 1 Top = 0 Width = 10590 Begin VB.CommandButton btnNewAccount BackColor = &H00808080& Height = 495 Left = 90 Picture = "Accounts.frx":0000 Style = 1 'Graphical TabIndex = 4 Top = 360 Width = 975 End Begin VB.CommandButton btnEditAccount BackColor = &H00808080& Height = 495 Left = 1200 Picture = "Accounts.frx":0952 Style = 1 'Graphical TabIndex = 3 Top = 360 Width = 975 End Begin VB.CommandButton btnDeleteAccount BackColor = &H00808080& Height = 495 Left = 2280 Picture = "Accounts.frx":12A4 Style = 1 'Graphical TabIndex = 2 Top = 360 Width = 975 End Begin VCF150Ctl.F1Book F1Book1 Height = 7140 Left = 120 TabIndex = 0 Top = 945 Width = 10275 _ExtentX = 18124 _ExtentY = 12594 _0 = $"Accounts.frx":1C62 _1 = $"Accounts.frx":2067 _2 = $"Accounts.frx":246C _3 = $"Accounts.frx":2871 _4 = $"Accounts.frx":2C76 _5 = $"Accounts.frx":307B _6 = $"Accounts.frx":3481 _7 = $"Accounts.frx":3888 _8 = $"Accounts.frx":3C8E _9 = $"Accounts.frx":4093 _10 = $"Accounts.frx":4499 _11 = $"Accounts.frx":489E _12 = $"Accounts.frx":4CA3 _13 = $"Accounts.frx":50A8 _14 = $"Accounts.frx":54AD _15 = $"Accounts.frx":58B2 _16 = $"Accounts.frx":5CB8 _17 = $"Accounts.frx":60BD _18 = $"Accounts.frx":64C2 _19 = $"Accounts.frx":68C7 _20 = $"Accounts.frx":6CCD _21 = $"Accounts.frx":70D2 _22 = $"Accounts.frx":74D7 _23 = $"Accounts.frx":78DC _24 = $"Accounts.frx":7CE1 _25 = $"Accounts.frx":80E6 _26 = $"Accounts.frx":84EC _27 = $"Accounts.frx":88F2 _28 = $"Accounts.frx":8CF7 _29 = $"Accounts.frx":90FC _30 = $"Accounts.frx":9501 _31 = $"Accounts.frx":9906 _32 = $"Accounts.frx":9D0B _33 = $"Accounts.frx":A110 _34 = $"Accounts.frx":A515 _35 = $"Accounts.frx":A91A _36 = $"Accounts.frx":AD1F _37 = $"Accounts.frx":B124 _38 = $"Accounts.frx":B529 _39 = $"Accounts.frx":B92E _40 = $"Accounts.frx":BD33 _41 = $"Accounts.frx":C138 _42 = $"Accounts.frx":C53D _43 = $"Accounts.frx":C943 _44 = $"Accounts.frx":CD49 _45 = $"Accounts.frx":D14E _46 = $"Accounts.frx":D554 _47 = $"Accounts.frx":D959 _48 = $"Accounts.frx":DD5F _49 = $"Accounts.frx":E164 _50 = $"Accounts.frx":E569 _51 = $"Accounts.frx":E96E _52 = $"Accounts.frx":ED74 _53 = $"Accounts.frx":F179 _54 = $"Accounts.frx":F57F _55 = $"Accounts.frx":F984 _56 = $"Accounts.frx":FD89 _57 = $"Accounts.frx":1018E _58 = $"Accounts.frx":10593 _59 = $"Accounts.frx":10999 _60 = $"Accounts.frx":10D9F _61 = $"Accounts.frx":111A4 _62 = $"Accounts.frx":115A9 _63 = $"Accounts.frx":119AE _64 = $"Accounts.frx":11DB3 _65 = $"Accounts.frx":121B8 _66 = $"Accounts.frx":125BE _67 = $"Accounts.frx":129C4 _68 = $"Accounts.frx":12DC9 _69 = $"Accounts.frx":131CE _70 = $"Accounts.frx":135D3 _71 = $"Accounts.frx":139D8 _72 = $"Accounts.frx":13DDD _73 = $"Accounts.frx":141E3 _74 = $"Accounts.frx":145E8 _75 = $"Accounts.frx":149ED _76 = $"Accounts.frx":14DF2 _77 = $"Accounts.frx":151F7 _78 = $"Accounts.frx":155FC _79 = $"Accounts.frx":15A01 _80 = $"Accounts.frx":15E06 _81 = $"Accounts.frx":1620B _82 = $"Accounts.frx":16610 _83 = $"Accounts.frx":16A15 _84 = $"Accounts.frx":16E1A _85 = $"Accounts.frx":1721F _86 = $"Accounts.frx":17624 _87 = $"Accounts.frx":17A29 _88 = $"Accounts.frx":17E2E _89 = $"Accounts.frx":18233 _90 = $"Accounts.frx":18638 _91 = $"Accounts.frx":18A3D _92 = $"Accounts.frx":18E42 _93 = $"Accounts.frx":19247 _94 = $"Accounts.frx":1964C _95 = $"Accounts.frx":19A51 _96 = $"Accounts.frx":19E56 _97 = $"Accounts.frx":1A25B _98 = $"Accounts.frx":1A660 _99 = $"Accounts.frx":1AA65 _100 = $"Accounts.frx":1AE6B _101 = $"Accounts.frx":1B270 _102 = $"Accounts.frx":1B675 _103 = $"Accounts.frx":1BA7A _104 = $"Accounts.frx":1BE7F _105 = $"Accounts.frx":1C285 _106 = $"Accounts.frx":1C68A _107 = $"Accounts.frx":1CA8F _108 = $"Accounts.frx":1CE94 _109 = $"Accounts.frx":1D29A _110 = $"Accounts.frx":1D69F _111 = $"Accounts.frx":1DAA4 _112 = $"Accounts.frx":1DEA9 _113 = $"Accounts.frx":1E2AE _114 = $"Accounts.frx":1E6B3 _115 = $"Accounts.frx":1EAB8 _116 = $"Accounts.frx":1EEBE _117 = $"Accounts.frx":1F2C3 _118 = $"Accounts.frx":1F6C8 _119 = $"Accounts.frx":1FACD _120 = $"Accounts.frx":1FED3 _121 = $"Accounts.frx":202D8 _122 = $"Accounts.frx":206DD _123 = $"Accounts.frx":20AE2 _124 = $"Accounts.frx":20EE7 _125 = $"Accounts.frx":212EC _126 = $"Accounts.frx":216F1 _127 = $"Accounts.frx":21AF6 _128 = $"Accounts.frx":21EFB _129 = $"Accounts.frx":22300 _130 = $"Accounts.frx":22705 _131 = $"Accounts.frx":22B0A _132 = $"Accounts.frx":22F0F _133 = $"Accounts.frx":23315 _134 = $"Accounts.frx":2371A _135 = $"Accounts.frx":23B1F _136 = $"Accounts.frx":23F24 _137 = $"Accounts.frx":24329 _138 = $"Accounts.frx":2472E _139 = $"Accounts.frx":24B33 _140 = $"Accounts.frx":24F38 _141 = $"Accounts.frx":2533D _142 = $"Accounts.frx":25743 _143 = $"Accounts.frx":25B48 _144 = $"Accounts.frx":25F4D _145 = $"Accounts.frx":26353 _146 = $"Accounts.frx":26759 _147 = $"Accounts.frx":26B5E _148 = $"Accounts.frx":26F63 _149 = $"Accounts.frx":27368 _150 = $"Accounts.frx":2776D _151 = $"Accounts.frx":27B73 _152 = $"Accounts.frx":27F77 _153 = $"Accounts.frx":2837D _154 = $"Accounts.frx":28782 _155 = $"Accounts.frx":28B87 _156 = $"Accounts.frx":28F8C _157 = $"Accounts.frx":29391 _158 = $"Accounts.frx":29796 _159 = $"Accounts.frx":29B9B _160 = $"Accounts.frx":29FA0 _161 = $"Accounts.frx":2A3A4 _162 = $"Accounts.frx":2A7A9 _163 = $"Accounts.frx":2ABAE _164 = $"Accounts.frx":2AFB3 _165 = $"Accounts.frx":2B3B8 _166 = $"Accounts.frx":2B7BC _167 = $"Accounts.frx":2BBC0 _168 = $"Accounts.frx":2BFC5 _169 = $"Accounts.frx":2C3C9 _170 = $"Accounts.frx":2C7CD _171 = $"Accounts.frx":2CBD1 _172 = $"Accounts.frx":2CFD6 _173 = $"Accounts.frx":2D3DB _174 = $"Accounts.frx":2D7E1 _175 = $"Accounts.frx":2DBE7 _176 = $"Accounts.frx":2DFEC _177 = $"Accounts.frx":2E3F1 _178 = $"Accounts.frx":2E7F6 _179 = $"Accounts.frx":2EBFB _180 = $"Accounts.frx":2F000 _181 = $"Accounts.frx":2F405 _182 = $"Accounts.frx":2F80A _183 = $"Accounts.frx":2FC0F _184 = $"Accounts.frx":30014 _185 = $"Accounts.frx":30419 _186 = $"Accounts.frx":3081E _187 = $"Accounts.frx":30C23 _188 = $"Accounts.frx":31028 _189 = $"Accounts.frx":3142D _190 = $"Accounts.frx":31832 _191 = $"Accounts.frx":31C37 _192 = $"Accounts.frx":3203C _193 = $"Accounts.frx":32441 _194 = $"Accounts.frx":32846 _195 = $"Accounts.frx":32C4B _196 = $"Accounts.frx":33050 _197 = $"Accounts.frx":33455 _198 = $"Accounts.frx":3385A _199 = $"Accounts.frx":33C5F _200 = $"Accounts.frx":34064 _201 = $"Accounts.frx":34469 _202 = $"Accounts.frx":3486E _203 = $"Accounts.frx":34C73 _204 = $"Accounts.frx":35078 _205 = $"Accounts.frx":3547D _206 = $"Accounts.frx":35882 _207 = $"Accounts.frx":35C87 _208 = $"Accounts.frx":3608C _209 = $"Accounts.frx":36491 _210 = $"Accounts.frx":36896 _211 = $"Accounts.frx":36C9B _212 = $"Accounts.frx":370A0 _213 = $"Accounts.frx":374A5 _214 = $"Accounts.frx":378AA _215 = $"Accounts.frx":37CAF _216 = $"Accounts.frx":380B4 _217 = $"Accounts.frx":384B9 _218 = $"Accounts.frx":388BE _219 = $"Accounts.frx":38CC3 _220 = $"Accounts.frx":390C8 _count = 221 _ver = 1 End End Begin VB.Menu mnuFile Caption = "&File" Begin VB.Menu mnuFileNew Caption = "&New" End Begin VB.Menu mnuFileOpen Caption = "&Open" End Begin VB.Menu mnuFileSave Caption = "&Save" End End Attribute VB_Name = "Accounts" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_PredeclaredId = True Attribute VB_Exposed = False Dim PrevSheet As Integer Dim PrevRow As Long Dim PrevCol As Long Dim NumAccounts As Integer Dim NumCategories As Integer Dim hdrFormat As F1CellFormat Dim F1View As F1BookView Private Sub btnEditAccount_Click() Dim AccountName As String Dim pAccountName As String pAccountName = F1Book1.TextRC(F1Book1.Row, 1) AcctInfo.Show 1 AccountName = F1Book1.TextRC(F1Book1.Row, 1) If AccountName <> pAccountName Then While F1Book1.SheetName(F1Book1.Sheet) <> pAccountName F1Book1.Sheet = F1Book1.Sheet + 1 Wend F1Book1.SheetName(F1Book1.Sheet) = AccountName F1Book1.Sheet = 1 End If End Sub Private Sub btnNewAccount_Click() Dim AccountName As String Dim x As Integer Dim y As Integer If F1Book1.SheetName(F1Book1.Sheet) = "Accounts" Then F1Book1.SetFocus ' F1View.ShowSelections = F1Off F1Book1.Row = NumAccounts + 1 F1Book1.Col = 1 AcctInfo.Show 1 AccountName = F1Book1.TextRC(F1Book1.Row, 1) Call AddAccountSheet(AccountName) F1View.FormulaSRC(1, F1View.Row, 4) = "COUNT(" & AccountName & "!A3:A100)" F1View.FormulaSRC(1, F1View.Row, 5) = AccountName & "!H99" F1View.Sheet = 2 ' F1View.ShowSelections = F1Off F1View.Col = NumAccounts + 4 F1View.Row = 2 F1View.Formula = "Accounts!A" & NumAccounts + 1 F1View.SetFont "Arial", 8, True, True, False, False, 0, False, False F1View.Row = 3 F1View.Formula = "SUMIF(" & AccountName & "!$I$3:$I$100,$B3," & AccountName & "!$G$2:$G$99)-SUMIF(" & AccountName & "!$I$3:$I$100,$B3," & AccountName & "!$E$2:$E$99)" F1View.SetSelection 3, F1View.Col, NumCategories + 2, F1View.Col F1View.EditCopyDown F1View.SetBorder -1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0 F1View.ShowSelections = F1Auto F1View.SetSelection 3, F1View.Col, NumCategories + 2, F1View.Col F1View.FormulaRC(NumCategories + 4, F1View.Col) = "Sum(" & F1View.Selection & ")" F1View.SetSelection 1, 1, 1, 1 F1View.Sheet = 3 y = 0 For x = 1 To 12 y = y + 3 + NumAccounts F1View.Col = y F1View.InsertRange 1, F1View.Col, 1, F1View.Col, F1ShiftCols + F1FixupAppend F1View.ColHidden(F1View.Col) = True F1View.Row = 3 F1View.Formula = "SUMIF(" & AccountName & "!$I$3:$I$100,B3," & AccountName & "!$G$2:$G$99)-SUMIF(" & AccountName & "!$I$3:$I$100,B3," & AccountName & "!$E$2:$E$99)" F1View.SetSelection 3, F1View.Col, NumCategories + 2, F1View.Col F1View.EditCopyDown y = y + 1 Next x F1View.Sheet = 1 ' F1View.ShowSelections = F1Auto NumAccounts = NumAccounts + 1 End If If F1Book1.SheetName(F1Book1.Sheet) = "Category Summary" Then F1Book1.Row = NumCategories + 3 F1Book1.Col = 1 F1View.EnableProtection = False F1View.InsertRange F1View.Row, 1, F1View.Row, 1, F1ShiftRows + F1FixupAppend ' F1Book1.InsertDlg F1View.SetSelection F1View.Row - 1, 2, F1View.Row, F1View.LastCol F1View.EditCopyDown F1View.Row = F1View.Row + 1 F1View.Col = 1 F1Book1.StartEdit False, False, False F1Book1.SetFocus F1View.EnableProtection = True NumCategories = NumCategories + 1 End If End Sub Private Sub F1Book1_DblClick(ByVal nRow As Long, ByVal nCol As Long) Dim fnd As String Dim acct As String Dim pFound As Long F1Book1.Repaint = False If F1Book1.SheetName(F1Book1.Sheet) = "Accounts" Then If nRow = 0 Then F1Book1.Sort 1, 1, NumAccounts, 256, True, 1 Else While F1Book1.SheetName(F1Book1.Sheet) <> F1Book1.TextSRC(1, nRow, 1) F1Book1.Sheet = F1Book1.Sheet + 1 Wend End If ElseIf F1Book1.SheetName(F1Book1.Sheet) <> "Category Summary" Then F1Book1.StartEdit False, True, False End If If F1Book1.SheetName(F1Book1.Sheet) = "Category Summary" And F1Book1.Row > 1 And F1Book1.Col > 2 Then fnd = Abs(F1Book1.Number) acct = F1Book1.TextRC(1, nCol) While F1Book1.SheetName(F1Book1.Sheet) <> acct F1Book1.Sheet = F1Book1.Sheet + 1 Wend ElseIf (F1Book1.SheetName(F1Book1.Sheet) = "Category Summary" Or F1Book1.SheetName(F1Book1.Sheet) = "Budget") And F1Book1.Row < 3 Then F1Book1.Sort 3, 1, NumCategories + 2, 256, True, 1 End If F1Book1.Repaint = True End Sub Private Sub F1Book1_EndEdit(EditString As String, Cancel As Integer) Dim InsertRow As Long Dim Category As String If F1Book1.SheetName(F1Book1.Sheet) = "Category Summary" Then Call FillCombo F1Book1.Sheet = 2 Category = F1Book1.Text InsertRow = F1Book1.Row F1Book1.Sheet = 3 F1Book1.Row = InsertRow F1Book1.InsertRange F1Book1.Row, 1, F1Book1.Row, 1, F1ShiftRows + F1FixupAppend F1Book1.Col = 1 F1Book1.Text = Category F1Book1.SetSelection F1Book1.Row - 1, 2, F1Book1.Row, 256 F1Book1.EditCopyDown F1Book1.Sheet = 2 End If End Sub Private Sub F1Book1_SelChange() Dim pLocked As Boolean Dim pHidden As Boolean Dim objID As Long Dim pX1 As Single Dim pY1 As Single Dim pX2 As Single Dim pY2 As Single F1Book1.Repaint = False If F1Book1.SheetName(F1Book1.Sheet) = "" Then F1Book1.Sheet = PrevSheet Exit Sub End If If F1Book1.Sheet <> PrevSheet Then frmSheetName.Caption = F1Book1.SheetName(F1Book1.Sheet) End If If (F1Book1.SheetName(F1Book1.Sheet) = "Budget") Then btnNewAccount.Enabled = False btnEditAccount.Enabled = False btnDeleteAccount.Enabled = False Else btnNewAccount.Enabled = True btnEditAccount.Enabled = True btnDeleteAccount.Enabled = True End If If (F1Book1.SheetName(F1Book1.Sheet) <> "Accounts") And (F1Book1.SheetName(F1Book1.Sheet) <> "Category Summary") And (F1Book1.SheetName(F1Book1.Sheet) <> "Budget") Then F1Book1.GetProtection pLocked, pHidden If pLocked Then F1Book1.Row = PrevRow F1Book1.Col = PrevCol End If If F1Book1.Row Mod 2 = 1 Then objID = F1Book1.ObjNameToID("chkCleared") F1Book1.ObjGetPos objID, pX1, pY1, pX2, pY2 F1Book1.ObjSetPos objID, pX1, F1Book1.Row - 1 + 0.21875, pX2, F1Book1.Row - 0.175781 If F1Book1.TextRC(F1Book1.Row, 6) = "X" Then F1Book1.ObjValue(objID) = 1 Else F1Book1.ObjValue(objID) = 0 End If Else objID = F1Book1.ObjNameToID("chkCleared") F1Book1.ObjGetPos objID, pX1, pY1, pX2, pY2 F1Book1.ObjSetPos objID, pX1, F1Book1.Row - 2 + 0.21875, pX2, F1Book1.Row - 1 - 0.175781 If F1Book1.TextRC(F1Book1.Row - 1, 6) = "X" Then F1Book1.ObjValue(objID) = 1 Else F1Book1.ObjValue(objID) = 0 End If End If If (F1Book1.TextRC(2, F1Book1.Col) = "Category") And (F1Book1.Row Mod 2 = 0) Then objID = F1Book1.ObjNameToID("cboCategories") F1Book1.ObjGetPos objID, pX1, pY1, pX2, pY2 F1Book1.ObjSetPos objID, pX1, F1Book1.Row - 1, pX2, F1Book1.Row + 15 F1Book1.ObjSetCell objID, 2, F1Book1.Row, 3 F1Book1.ObjVisible(objID) = True F1Book1.Recalc Else objID = F1Book1.ObjNameToID("cboCategories") F1Book1.ObjVisible(objID) = False End If End If PrevSheet = F1Book1.Sheet PrevRow = F1Book1.Row PrevCol = F1Book1.Col F1Book1.Repaint = True End Sub Private Sub F1Book1_StartEdit(EditString As String, Cancel As Integer) If (F1Book1.SheetName(F1Book1.Sheet) <> "Accounts") And (F1Book1.SheetName(F1Book1.Sheet) <> "Category Summary") Then ' If F1Book1.TextRC(1, F1Book1.Col) = "Date" Then ' EditString = Date ' End If If F1Book1.TextRC(1, F1Book1.Col) = "Clr" Then Cancel = True If F1Book1.ObjValue(F1Book1.ObjNameToID("chkCleared")) = 1 Then F1Book1.ObjValue(F1Book1.ObjNameToID("chkCleared")) = 0 F1Book1.TextRC(F1Book1.Row, F1Book1.Col) = "" Else F1Book1.ObjValue(F1Book1.ObjNameToID("chkCleared")) = 1 F1Book1.TextRC(F1Book1.Row, F1Book1.Col) = "X" End If Exit Sub End If If (F1Book1.TextRC(2, F1Book1.Col) = "Category") And (F1Book1.Row Mod 2 = 0) Then Cancel = True Exit Sub End If End If End Sub Private Sub F1Book1_TopLeftChanged() If F1Book1.SheetName(F1Book1.Sheet) <> "Accounts" And F1Book1.SheetName(F1Book1.Sheet) <> "Category Summary" Then If (F1Book1.TopRow Mod 2) = 0 Then F1Book1.TopRow = F1Book1.TopRow + 1 End If End If End Sub Private Sub Form_Load() NumAccounts = 2 NumCategories = 19 Call CreateCellFormats Set F1View = F1Book1.CreateBookView Call FillCombo F1Book1.Sheet = 1 F1View.Sheet = 1 frmSheetName.Caption = "Accounts" End Sub Private Sub mnuFileNew_Click() Dim ftype As F1FileTypeConstants On Error GoTo mnuFileNewError ftype = F1Book1.ReadEx("Accounts.Vts") F1Book1.ShowEditBar = False Call FillCombo Exit Sub mnuFileNewError: If Err <> 20023 Then MsgBox "Error loading template file!" End If End Sub Private Sub mnuFileOpen_Click() Dim fname As String Dim ftype As F1FileTypeConstants On Error GoTo mnuFileOpenError fname = F1Book1.OpenFileDlgEx("Open Account", F1Book1.hWnd) ftype = F1Book1.ReadEx(fname) F1Book1.ShowEditBar = False Call FillCombo Exit Sub mnuFileOpenError: If Err <> 20023 Then MsgBox "Error loading file!" End If End Sub Private Sub mnuFileSave_Click() Dim pFileSpec As New F1FileSpec On Error GoTo mnuFileSaveError F1Book1.SaveFileDlgEx "Save Account", pFileSpec F1Book1.WriteEx pFileSpec.Name, pFileSpec.Type Exit Sub mnuFileSaveError: If Err <> 20023 Then MsgBox "Error saving file!" End If End Sub Public Sub FillCombo() Dim objID As Long Dim nSheet As Long Dim nRow As Long Dim nCol As Long Dim cboItem As String Dim nSheets As Integer PrevSheet = 1 PrevRow = 1 PrevCol = 1 ' F1View.DoEndEdit = False For nSheets = 4 To F1View.NumSheets - 1 F1View.Sheet = nSheets objID = F1View.ObjNameToID("cboCategories") nRow = 3 cboItem = F1View.TextSRC(2, nRow, 1) While cboItem <> "" F1View.ObjAddItem objID, cboItem nRow = nRow + 1 cboItem = F1View.TextSRC(2, nRow, 1) Wend F1View.ObjVisible(objID) = False Next nSheets ' F1View.DoEndEdit = True End Sub Public Sub AddAccountSheet(SheetName As String) Dim pID As Long Dim x As Integer ' F1View.DoSelChange = False F1View.InsertSheets F1View.NumSheets, 1 F1View.SheetName(F1View.NumSheets - 1) = SheetName F1View.Sheet = F1View.NumSheets - 1 ' F1View.ShowSelections = F1Off F1View.ShowGridLines = False F1View.ShowColHeading = False F1View.ShowRowHeading = False F1View.MaxCol = 9 F1View.MaxRow = 100 F1View.FixedRow = 1 F1View.FixedRows = 2 F1View.ObjNew F1ObjDropDown, 2, 2, 3, 3, pID F1View.ObjName(pID) = "cboCategories" Call FillCombo F1View.ObjNew F1ObjCheckBox, 5.227539, 2.234375, 5.772461, 2.882813, pID F1View.ObjName(pID) = "chkCleared" F1View.SetSelection 1, 1, 1, 3 F1View.AddSelection 1, 4, 1, 8 F1View.AddSelection 2, 1, 2, 8 F1View.SetCellFormat hdrFormat ' Temporary workaround for bug with Cell Format of FontName F1View.SetFont "Arial", 8, True, True, False, False, 0, False, False F1View.SetSelection 3, -1, 15, -1 F1View.SetProtection False, False F1View.SetSelection 3, 1, 100, 8 F1View.SetBorder -1, 1, 1, -1, 1, 0, 0, 0, 0, 0, 0 F1View.SetFont "Arial", 8, False, False, False, False, 0, False, False For x = 3 To 100 If x Mod 2 = 1 Then F1View.SetSelection x, 1, x, 8 F1View.SetBorder -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0 F1View.SetSelection x, 4, x, 4 F1View.SetBorder -1, 0, -1, -1, -1, 0, 0, 0, 0, 0, 0 F1View.SetSelection x, 3, x, 3 F1View.SetBorder -1, -1, 0, -1, -1, 0, 0, 0, 0, 0, 0 F1View.SetSelection x, 8, x, 8 F1View.SetProtection True, False If x = 3 Then F1View.Formula = "G3-E3" Else F1View.Formula = "H" & x - 2 & "-E" & x & "+G" & x End If Else F1View.SetSelection x, 1, x, 2 F1View.AddSelection x, 5, x, 8 F1View.SetPattern 2, 0, RGB(51, 204, 204) F1View.SetProtection True, False F1View.SetSelection x, 3, x, 4 F1View.SetPattern 1, RGB(51, 204, 204), RGB(51, 204, 204) End If Next x F1View.SetSelection -1, 5, -1, 5 F1View.AddSelection -1, 7, -1, 7 F1View.AddSelection -1, 8, -1, 8 F1View.NumberFormat = "$#,##0.00_);[Red]($#,##0.00)" F1View.ColWidthUnits = F1ColWidthUnitsCharacters F1View.ColWidth(1) = 7.715 * 256 F1View.ColWidth(2) = 6.285 * 256 F1View.ColWidth(3) = 22.29 * 256 F1View.ColWidth(4) = 20.57 * 256 F1View.ColWidth(5) = 10.43 * 256 F1View.ColWidth(6) = 3.145 * 256 F1View.ColWidth(7) = 10.43 * 256 F1View.ColWidth(8) = 10.43 * 256 F1View.TextRC(1, 1) = "Date" F1View.TextRC(1, 2) = "Ref" F1View.TextRC(1, 3) = "Payee" F1View.TextRC(1, 6) = "Clr" F1View.TextRC(1, 8) = "Balance" F1View.TextRC(2, 3) = "Category" F1View.TextRC(2, 4) = "Memo" If F1View.TextSRC(1, NumAccounts + 1, 2) = "CCard" Then F1View.TextRC(1, 5) = "Charge" F1View.TextRC(1, 7) = "Payment" Else F1View.TextRC(1, 5) = "Payment" F1View.TextRC(1, 7) = "Deposit" End If Dim formulatext As String formulatext = "TEXT(A3," & """" & "mmmm" & """" & ")&YEAR(A3)&C4" F1View.FormulaSRC(NumAccounts + 4, 4, 9) = formulatext F1View.SetSelection 4, 9, 100, 9 F1View.EditCopyDown F1View.ColHidden(9) = True F1View.EnableProtection = True F1View.SetSelection 3, 1, 3, 1 ' F1View.ShowSelections = F1On ' F1View.DoSelChange = True End Sub Public Sub CreateCellFormats() Set hdrFormat = F1Book1.CreateNewCellFormat With hdrFormat .FontName = "Arial" .FontSize = 8 .FontBold = True .FontItalic = True .PatternStyle = 1 .PatternFG = RGB(51, 204, 204) .ProtectionLocked = True .BorderColor(F1BottomBorder) = 0 .BorderColor(F1TopBorder) = 0 .BorderColor(F1HInsideBorder) = 0 .BorderColor(F1VInsideBorder) = 0 .BorderStyle(F1BottomBorder) = F1BorderThick .BorderStyle(F1TopBorder) = F1BorderThin .BorderStyle(F1HInsideBorder) = F1BorderThin .BorderStyle(F1VInsideBorder) = F1BorderThin End With End Sub